package tests;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Before;
import org.junit.Test;

import users.Role;
import users.User;

/**
 * Junit test for the User class. 
 * @author Lun-Wei Chang
 * @version 3/19/2014
 */
public class UserTest {
  
  /** A unique identification number for each user.  Used primarily
   * for database lookup tables. */
  private long my_id;

  /** The email address of the registered user.  This must be provided
   * during registration and cannot be blank or otherwise invalid. */
  private String my_email;

  /** The first name of the user. */
  private String my_first_name;

  /** The last name of the user. */
  private String my_last_name;

  /** The list of roles that the user has per conference, if any. */
  private List<Role> my_roles;

  /** 
   * Constructs a new User data object.
   * @throws Exception throws an exception if constructions failed. 
   */
  @Before
  public void setUp() throws Exception {
    final User person = new User("David", "Chang", "aspirine539@gmail.com");
    my_id = person.getID();
    my_first_name = person.getFirstName();
    my_last_name = person.getLastName();
    my_email = person.getEmail();
    my_roles = person.getRoles();
  }
  
  /** Tests the getID method. */
  @Test 
  public void getID() {
    assertNotNull("Empty ID!", my_id);
  }

  /** Tests the setID method. */
  @Test 
  public void setID() {
    assertNotNull("Empty ID!", my_id);
  }

  /** Tests the getEmail method. */
  @Test 
  public void getEmail() {
    assertNotNull("Empty email!", my_email);
  }

  /** Tests the getFirstName method. */
  @Test 
  public void getFirstName() {
    assertNotNull("Empty first name!", my_first_name);
  }

  /** Tests the getLastName method. */
  @Test 
  public void getLastName() {
    assertNotNull("Empty last name!", my_last_name);
  }
  
  /** Tests the getFullName method. */
  @Test 
  public void getFullName() {
    assertNotNull("Empty first name!", my_first_name);
    assertNotNull("Empty last name!", my_last_name);
  }

  /** Tests the v method. */
  @Test 
  public void getRoles() {
    assertNotNull("Empty list of roles!", my_roles);
  }
  
  /** Tests the addRole method. */
  @Test 
  public void addRole() {
    assertNotNull("Empty list of roles!", my_roles);
    
  }
}
